package com.briup.cms.service.impl;

import com.briup.cms.bean.RolePrivilege;
import com.briup.cms.dao.RolePrivilegeMapper;
import com.briup.cms.service.IRolePrivilegeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class RolePrivilegeServiceImpl implements IRolePrivilegeService {
    @Resource
    private RolePrivilegeMapper rolePrivilegeMapper;

    @Override
    public List<RolePrivilege> findAll() {
        List<RolePrivilege> list = rolePrivilegeMapper.selectAll();
        return list;
    }

    @Override
    public void saveOrUpdate(RolePrivilege rolePrivilege) {
        if (rolePrivilege.getId() != null) {
            rolePrivilegeMapper.update(rolePrivilege);
        } else {
            rolePrivilegeMapper.insert(rolePrivilege);
        }
    }


    @Override
    public void deleteById(long id) {
        rolePrivilegeMapper.deleteById(id);
    }
}





